<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:c="http://java/sun.com/jslt/core"
	  xmlns:o="http://openfaces.org/"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions">

    <head>
    </head>
    <body>
        <ui:composition template="/templates/default.xhtml">
		    <ui:define name="title">OpenHDS - Pregnancy Outcome Details</ui:define>
		
			<ui:param name="crud" value="#{pregnancyOutcomeCrud}" />
			
            <ui:define name="listing">
				<ui:include src="list.xhtml" />
            </ui:define>
            
            <ui:define name="display">
           		<style>
					.base-table {
						border:0px solid #98BF21;
						border-collapse:collapse;
						border-color:#888;
						table-layout:fixed;
					}
					   		
					.base-table th {
					   	background-color:#B9D264;
						font-weight:bold;
						font-size:.9em;
						overflow:hidden;
					 }
					   		
					.base-table td {
					   	padding:5px 5px 5px;
					   	text-align:center;
					 }
					   		
					.base-table a {
					   	width:100%;
						border:0;
					 }
					   		
					 .base-table .alt {
					   	background-color:#CCC;
					 }
					   		
					.base-table .alt-col {
						width:40%;
					 }
					 
					.base-table-center {
					   	margin:0 auto;
					 }
				</style>
         		
    			<h:outputText value="#{navController.breadcrumbTrail}" />	
         		
                <h1>#{msg.pregnancyOutcomeDetail}</h1>
                <h:messages id="error" globalOnly="true" />
                <h:form id="pregnancyOutcomeForm">
                
                	<h:outputText styleClass="error" value="#{pregnancyOutcomeCrud.item.statusMessage}" />
                
                    <h:panelGrid columns="3">
                        <h:outputText value="#{msg.individualMotherId}:"/>
                        <h:outputText />
                        <h:outputText id="motherExtId" value="#{pregnancyOutcomeCrud.item.mother}" converter="#{individualExtIdConverter}" />
                        
                        <h:outputText value="#{msg.individualFatherId}:"/>
                        <h:outputText />
                        <h:outputText id="fatherExtId" value="#{pregnancyOutcomeCrud.item.father}" converter="#{individualExtIdConverter}" />
	                  	
	                  	<h:outputText value="#{msg.visitId}:"/>
	                  	<h:outputText />
	                  	<h:outputText id="visit" value="#{pregnancyOutcomeCrud.item.visit}" converter="#{visitExtIdConverter}" />
                        
                        <h:outputText value="#{msg.pregnancyOutcomeRecordedDate}:"/>
                        <h:outputText />
                        <h:outputText id="date" value="#{pregnancyOutcomeCrud.item.outcomeDate}" converter="#{calendarConverter}" />
                        
                        <h:outputText value="#{msg.pregnancyOutcomeTotalOutcomes}:"/>
                        <h:outputText />
                        <h:outputText id="everBorn" value="#{pregnancyOutcomeCrud.item.childEverBorn}" converter="#{defaultConverter}" />
                        
                        <h:outputText value="#{msg.pregnancyOutcomeTotalLiveBirths}:"/>
                        <h:outputText />
                        <h:outputText id="liveBirthNum" value="#{pregnancyOutcomeCrud.item.numberOfLiveBirths}" converter="#{defaultConverter}" />
						
						<h:outputText value="#{msg.insertDate}:"/>
	                	<h:outputText />
	                	<h:outputText value="#{pregnancyOutcomeCrud.item.insertDate}" converter="#{calendarConverter}" />
						
						<h:outputText value="#{msg.insertBy}:"/>
						<h:outputText />
						<h:outputText value="#{pregnancyOutcomeCrud.item.insertBy.fullName}" />
						
						<h:outputText value="#{msg.dataStatus}:"/>
		    			<img class="clickable" onclick="O$('popupWindowForDataStatus').showCentered();" src="#{request.contextPath}/resources/images/question.png" />
						<h:outputText value="#{pregnancyOutcomeCrud.item.status}" />	
					</h:panelGrid>
                    <br />
  					<h:dataTable value="#{pregnancyOutcomeCrud.item.outcomes}" rendered="#{fn:length(pregnancyOutcomeCrud.item.outcomes) > 0}" var="item"
  							styleClass="base-table" rowClasses=",alt" columnClasses=",alt-col" width="30%">
               			<h:column>
	                        <f:facet name="header">
	                        	<h:panelGroup>
	                            	<h:outputText value="#{msg.pregnancyOutcomeType}"/>
	                            	<img class="clickable" onclick="O$('popupWindowForPregOutcome').showCentered();" src="#{request.contextPath}/resources/images/question.png" />
	                            </h:panelGroup>
	                        </f:facet>
	                        <h:outputText value="#{item.type}"/>
	                    </h:column>
               			<h:column>
	                        <f:facet name="header">
	                            <h:outputText value="#{msg.individualId}"/>
	                        </f:facet>
	                        <h:outputText value="#{item.child == null ? '' : item.child.extId}"/>
	                    </h:column>
                   	</h:dataTable>
                   	<br />
                   	<h:commandButton value="#{msg.lblCancel}" immediate="true" action="cancel" rendered="#{flowScope.updating}" />
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
